<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:body>

        <ui:composition template="././resources/template/template.xhtml">
            <ui:define name="content">
                <h:form>
                    <p:panel header="Pharmacy Item List">
                        <h:panelGrid columns="2">
                            <p:commandButton ajax="false" value="Item" action="#{ampController.pharmacyNoDeleteItem()}" onclick="onSubmitButton();" ></p:commandButton>
                            <p:commandButton ajax="false" value="deleted Item" action="#{ampController.pharmacyDeleteItem()}" onclick="onSubmitButton();" ></p:commandButton>
                        </h:panelGrid>
                        <h:panelGroup id="pharmacyItem">
                            <p:dataTable id="tbl" styleClass="noBorder normalFont" value="#{ampController.itemList}" var="i"  >
                            
                                <p:column headerText="Id">
                                    <f:facet name="header">
                                        <h:outputLabel value="ID"/>
                                    </f:facet>                                    
                                    <h:outputLabel value="#{i.id}"  >
                                    </h:outputLabel>
                                </p:column>
                                
                                <p:column headerText="item Name">
                                    <f:facet name="header">
                                        <h:outputLabel value="Item Name"/>
                                    </f:facet>                                    
                                    <h:outputLabel value="#{i.name}"  >
                                    </h:outputLabel>
                                </p:column>
                                
                                <p:column headerText="created At">
                                    <f:facet name="header">
                                        <h:outputLabel value="Created At"/>
                                    </f:facet>                                    
                                    <h:outputLabel value="#{i.createdAt}"  >
                                    </h:outputLabel>
                                </p:column>
                                
                                <p:column headerText="created By">
                                    <f:facet name="header">
                                        <h:outputLabel value="Created By"/>
                                    </f:facet>                                    
                                    <h:outputLabel value="#{i.creater.webUserPerson}"  >
                                    </h:outputLabel>
                                </p:column>
                                
                                <p:column headerText="delete">
                                    <f:facet name="header">
                                        <h:outputLabel value="Deleted or Not"/>
                                    </f:facet>                                    
                                    <h:outputLabel value="#{i.retired eq true ? 'Deleted':'Not Deleted'}"  >
                                    </h:outputLabel>
                                </p:column>
                                
                            </p:dataTable>
                        </h:panelGroup>
                    </p:panel>
                </h:form>
            </ui:define>

        </ui:composition>

    </h:body>
</html>
